package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.Group;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
/**
* @author liaocheng
* @date 2024-10-30
* description:群表
*/
@Data
public class GroupDto extends BaseField {

    @ApiModelProperty(value = "id")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "群名字")
    private String groupName;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public Group invertEntity(){
        Group dto = new Group();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setGroupName(this.getGroupName());
        return dto;
    }
}
